<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:body>
    <ui:composition template="./Templates/TemplateInterno.xhtml">
    <ui:define name="topoInterno"></ui:define>      
    <ui:define name="content">
        <br/>
        <br/>
        <br/>
    <h:panelGroup layout="block" class="container">
        <h:panelGroup layout="block" class="row">
            <h:panelGroup layout="block" class="col-md-1"></h:panelGroup>
                <h:panelGroup layout="block" class="col-md-9">
                    <h:panelGroup layout="block" class="panel panel-default"> 
                        <h:panelGroup layout="block" class="panel-body">
                            <h:panelGroup layout="block" class="page-header">
                                    <h3>Configurações de Conta</h3>
                                    <hr></hr>
                                <h:panelGroup layout="block" class="tabbable"> 
                                        <ul class="nav nav-tabs">
                                          <li class="active"><a href="#tab1" data-toggle="tab">Alterar Senha</a></li>
                                          <li><a href="#tab2" data-toggle="tab">Cadastro</a></li>
                                        </ul>
                                    <h:panelGroup layout="block" class="tab-content">
                                        <h:panelGroup layout="block" class="tab-pane active" id="tab1">
                                        <br></br>
                                        <h:form role="form">
                                            <h:panelGroup layout="block" class="form-group">
                                                <h:outputLabel value="Nova Senha *"/>
                                                <h:panelGroup layout="block" class="input-group">
                                                    <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                                                    <h:inputSecret required="true" value="#{pessoaMB.pessoa.senha}" maxlength="40" class="form-control" requiredMessage="Informe a senha" style="width:250px;"/>
                                                </h:panelGroup>
                                                </h:panelGroup>
                                                <h:panelGroup layout="block" class="form-group">
                                                    <h:outputLabel value="Confirmação Nova Senha *"/>
                                                    <h:panelGroup layout="block" class="input-group">
                                                        <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                                                        <h:inputSecret  required="true" value="#{pessoaMB.confirmaSenha}" maxlength="40" class="form-control" style="width:250px;"/>
                                                    </h:panelGroup>
                                            </h:panelGroup>
                                            <h:commandButton value="Salvar" class="btn btn-success btn-min">
                                                <f:ajax event="click" 
                                                listener="#{pessoaMB.atualizarSenha}"
                                                execute="@all"
                                                render="msgSenha"/>
                                            </h:commandButton>
                                            <h:messages id="msgSenha"
                                            infoStyle="color: green" layout="table" showSummary="true" showDetail="false" globalOnly="true"/>
                                        </h:form>    
                                    </h:panelGroup>
                                        <h:panelGroup layout="block" class="tab-pane" id="tab2">
                                            <br/>
                                            <h:form role="form">
                                                <h:panelGroup layout="block" class="form-group">
                                                    <h:outputLabel value="Email"/>
                                                    <h:panelGroup layout="block" class="input-group">
                                                        <span class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></span>
                                                        <h:inputText required="true" value="#{pessoaMB.pessoa.email}" maxlength="40" class="form-control" requiredMessage="Informe a senha"
                                                                style="width:250px;"/>
                                                    </h:panelGroup>
                                                </h:panelGroup>
                                                <h:panelGroup layout="block" class="form-group">
                                                    <h:outputLabel value="Nome"/>
                                                    <h:panelGroup layout="block" class="input-group">
                                                        <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
                                                        <h:inputText  required="true" value="#{pessoaMB.pessoa.nome}" maxlength="40" class="form-control" style="width:250px;"/>
                                                    </h:panelGroup>
                                                </h:panelGroup>
                                                <h:outputLabel value="Sexo"/>
                                                <h:panelGroup layout="block" class="input-group">
                                                        <span class="input-group-addon"><span class="glyphicon glyphicon-th-list"></span></span>
                                                    <h:selectOneMenu value="#{pessoaMB.pessoa.sexo}" style="width:60px;height:35px;border-radius:3px;">
                                                        <f:selectItem itemValue="" itemLabel="Sexo"/>  
                                                        <f:selectItem itemValue="M" itemLabel="M"/>  
                                                        <f:selectItem itemValue="F" itemLabel="F"/>  
                                                    </h:selectOneMenu>
                                                </h:panelGroup>
                                                <br/>
                                                <h:commandButton value="Salvar" class="btn btn-success btn-min" type="submit">
                                                    <f:ajax event="click" 
                                                    listener="#{pessoaMB.atualizarCadastro}"
                                                    execute="@all"
                                                    render="msg"/>
                                                </h:commandButton>
                                                <h:messages id="msg"
                                                  infoStyle="color: green" layout="table" showSummary="true" showDetail="false" globalOnly="true"/>
                                            </h:form>   
                                    </h:panelGroup>
                                </h:panelGroup>
                            </h:panelGroup>
                        </h:panelGroup>
                    </h:panelGroup>   
                </h:panelGroup>    
            </h:panelGroup>    
        </h:panelGroup>
    </h:panelGroup>
</ui:define>
<ui:define name="rodape"></ui:define>
</ui:composition>
</h:body>
</html>